package com.example.dragimage;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;

public class OtherActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_other);

       /* MyFraneLayout myFraneLayout = findViewById(R.id.framLayout);
        myFraneLayout.setmActivityListenet(new MyFraneLayout.OnFinshActivityListenet() {
            @Override
            public void onFinshActivityListenet() {
                finish();
            }
        });*/


        ViewPager viewPager = findViewById(R.id.viewPage);

        viewPager.setAdapter(new MyAdapyer(getSupportFragmentManager()));
    }


    class MyAdapyer extends FragmentPagerAdapter {

        public MyAdapyer(FragmentManager fm) {
            super(fm);
        }

        @Override
        public Fragment getItem(int position) {
            return MyFragment.newInstance();
        }

        @Override
        public int getCount() {
            return 3;
        }
    }

}
